package com.lc.demo;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import lc.com.androidproject.R;
import lc.com.androidproject.base.LCBaseFragment;
import lc.com.architecture.base.BaseApplication;

/**
 * @author LiuChao
 * @describe
 * @date 2017/11/14
 * @contact email:450127106@qq.com
 */

public class MainFragment extends LCBaseFragment<MainPresenter> implements MainView {

    @BindView(R.id.tv_text)
    TextView mTvText;

    public static MainFragment newInstance() {
        MainFragment mainFragment = new MainFragment();
        mainFragment.setArguments(new Bundle());
        return mainFragment;
    }

    @Override
    protected int getBodyLayoutId() {
        return R.layout.fragment_main;
    }

    @Override
    public void initData() {
        mIPresenter.showText();
    }

    @Override
    public void initView(View rootView) {

    }

    @Override
    protected void componentInject() {
        DaggerMainComponent.builder()
                .mainModule(new MainModule(this))
                .appComponent(BaseApplication.getAppComponent())
                .build().inject(this);
    }

    @Override
    public void showText(String text) {
        mTvText.setText(text);
    }

}
